#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXN 30

typedef struct {
    double data[MAXN];
    int top;
} Stack;
void push(Stack *s, double value) {
    s->data[++(s->top)] = value;
}
double pop(Stack *s) {
    return s->data[(s->top)--];
}
int is_operator(char *token) {
    return (strcmp(token, "+") == 0 || strcmp(token, "-") == 0 ||
            strcmp(token, "*") == 0 || strcmp(token, "/") == 0);
}
double evaluate_prefix(char *expr) {
    Stack s;
    s.top = -1;
    char *tokens[MAXN];
    int count = 0;
    char *token = strtok(expr, " ");
    while (token) {
        tokens[count++] = token;
        token = strtok(NULL, " ");
    }
    for (int i = count - 1; i >= 0; i--) {
        if (is_operator(tokens[i])) {
            if (s.top < 1) return -1; 
            double op1 = pop(&s);
            double op2 = pop(&s);
            if (strcmp(tokens[i], "+") == 0) push(&s, op1 + op2);
            else if (strcmp(tokens[i], "-") == 0) push(&s, op1 - op2);
            else if (strcmp(tokens[i], "*") == 0) push(&s, op1 * op2);
            else if (strcmp(tokens[i], "/") == 0) {
                if (op2 == 0) return -1; 
                push(&s, op1 / op2);
            }
        } else {
            push(&s, atof(tokens[i]));
        }
    }
    if (s.top != 0) return -1; // number & pattern not match
    return pop(&s);
}

int main() {
    char expr[100];
    fgets(expr, sizeof(expr), stdin);
    expr[strcspn(expr, "\n")] = 0; // delete enter line
    
    double result = evaluate_prefix(expr);
    if (result == -1) {
        printf("ERROR\n");
    } else {
        printf("%.1f\n", result);
    }
    return 0;
}
